package com.coocaa.ops.admin.v1.device.converter;


import com.coocaa.ops.admin.v1.device.model.GlobalDeviceInfoModel;
import com.coocaa.ops.common.core.base.util.PageQueryUtil;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

public class DeviceParamConverter {

    public static Map<String, Object> getParamMap(GlobalDeviceInfoModel model) {
        Map<String, Object> result = new HashMap<>();
        if (StringUtils.isNotBlank(model.getChip())) {
            result.put("chip", model.getChip());
        }
        if (StringUtils.isNotBlank(model.getModel())) {
            result.put("model", model.getModel());
        }
        if (StringUtils.isNotBlank(model.getPlatform())) {
            result.put("platform", model.getPlatform());
        }
        PageQueryUtil.handleFilterMap(model, result);
        return result;
    }
}
